import {createRouter,createWebHistory} from 'vue-router'

//导入组件
import Login from '@/views/Login.vue';
import Layout from '@/views/Layout.vue';

import ArticleCategory from '@/views/article/ArticleCategory.vue';
import ArticleMessage from '@/views/article/ArticleMessage.vue';
import UserAvatar from '@/views/user/UserAvatar.vue';
import userInfo from '@/views/user/UserInfo.vue';
import UserResetPassword from '@/views/user/UserResetPassword.vue';


const routes = [
    {
        path: '/login',components: Login
    },
    {
        path: '/',components: Layout,redirect: '/article/manage',children: [
            {path:'/article/category',components: ArticleCategory},
            {path:'/article/message',components: ArticleMessage},
            {path:'/user/avatar',components: UserAvatar},
            {path:'/user/info',components: userInfo},
            {path:'/user/resetPassword',components: UserResetPassword},
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})
export default router